//
//  OrderModel.m
//  RPay
//
//  Created by CharlieLiao on 2017/7/22.
//  Copyright © 2017年 Charlie. All rights reserved.
//

#import "OrderModel.h"
#import "MJExtension.h"
#import "CLExtension/CLExtension.h"

@implementation OrderGoodsModel


@end

@implementation OrderModel

- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property
{
    if ([property.name isEqualToString:@"orderTime"]) {
        NSDate *date = [NSDate dateWithTimestamp:oldValue];
        return [date toDateTimeString];
    }
    return oldValue;
}

/**
 *  数组中需要转换的模型类
 *
 *  @return 字典中的key是数组属性名，value是数组中存放模型的Class（Class类型或者NSString类型）
 */
+ (NSDictionary *)mj_objectClassInArray
{
    return @{@"detailList":OrderGoodsModel.class};
}


@end

@implementation OrderListModel

/**
 *  数组中需要转换的模型类
 *
 *  @return 字典中的key是数组属性名，value是数组中存放模型的Class（Class类型或者NSString类型）
 */
+ (NSDictionary *)mj_objectClassInArray
{
    return @{@"content":OrderModel.class};
}

@end


@implementation OrderModelReformer

- (id)manager:(CTAPIBaseManager *)manager reformData:(id)data
{
    return [OrderListModel mj_objectWithKeyValues:data];
}

@end
